<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});



//后台登录路由
Route::any('/login','IndexController@login');

//个人报名资源路由
Route::resource('registration','RegistrationController');

//企业报名资源路由
Route::resource('participate','ParticipateController');

//后台管理系统路由组，带中间件判断是否登录
Route::group(['middleware'=>['web','admin.login']],function (){
    //后台首页
    Route::get('admin/index','IndexController@index');

    //退出后台路由
    Route::get('/logout','IndexController@logout');

    // 文章资源路由
    Route::resource('article', 'ArticleController');

    // 用户资源路由
    Route::resource('user', 'UserController');

    //图片删除路由
    Route::post('delete/image','UploadController@delFileUpload');

    //文章审核路由
    Route::post('apply/article','ArticleController@apply');

    //公告列表路由
    Route::get('reg/article','RegistrationController@article');

});
//文件上传
Route::any('/admin/upload','UploadController@upload');

/**
 * 前端页面路由
 */

//首页
Route::get('','Index\IndexController@index');

Route::group(['middleware'=>['web'],'namespace'=>'Index','prefix'=>'api' ],function () {



    //文章详情页
    Route::get('detail','IndexController@detail');

    //更多
    Route::get('more','IndexController@more');

    //搜索
    Route::get('search','IndexController@search');

    //通过类别获取更多
    Route::get('category_more','IndexController@category_more');

    //车库首页
    Route::get('ck',function(){
       return view('index.ck');
    });

    //贤若首页
    Route::get('xr',function(){
        return view('index.xr');
    });

    //欧达首页
    Route::get('od',function(){
        return view('index.od');
    });

    //万学首页
    Route::get('wx',function(){
        return view('index.wx');
    });



});

